﻿using ServiceContracts.DTO;
using ServiceContracts.DTO.Enums;
using System;

/// <summary>
/// Represents business logic for manipulating Person entity
/// </summary>
namespace ServiceContracts
{
    public interface IPersonsService
    {
        /// <summary>
        /// Add a country object to the list of countries
        /// </summary>
        /// <param name="countryAddRequest">添加人员对象</param>
        /// <returns>返回添加的人员对象（包括新生成的人员ID）</returns>
        PersonResponse AddPerson(PersonAddRequest? personAddRequest);

        /// <summary>
        /// 返回所有人员列表
        /// </summary>
        /// <returns>所有人员列表</returns>
        List<PersonResponse> GetAllPersons();

        /// <summary>
        /// 根据personID获取PersonResponse
        /// </summary>
        /// <param name="personID"></param>
        /// <returns>匹配ID的人员</returns>
        PersonResponse? GetPersonByPersonID(Guid? personID);

        /// <summary>
        /// 返回所有匹配搜索条件的person对象
        /// </summary>
        /// <param name="searchBy"></param>
        /// <param name="searchString"></param>
        /// <returns></returns>
        List<PersonResponse> GetFilteredPersons(string searchBy,string? searchString);

        /// <summary>
        /// 返回排序后的persons列表
        /// </summary>
        /// <param name="allPersons">表示要排序的persons列表</param>
        /// <param name="sortBy">排序属性</param>
        /// <param name="sortOrder">排序类型</param>
        /// <returns></returns>
        List<PersonResponse> GetSortedPersons(List<PersonResponse> allPersons,string sortBy,SortOrderOptions sortOrder);

        /// <summary>
        /// 更新指定id的person实例
        /// </summary>
        /// <param name="personUpdateRequest"></param>
        /// <returns></returns>
        PersonResponse UpdatePerson(PersonUpdateRequest? personUpdateRequest);

        /// <summary>
        /// 删除指定id的人员
        /// </summary>
        /// <param name="personID">personID</param>
        /// <returns>返回删除成功还是失败</returns>
        bool DeletePerson(Guid? personID);
    }
}
